﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SwenAssigment.Classes
{
    public class Day
    {
        private DateTime Date;
        private int TotalRoom;
        private int ORoom;
        private Decimal OStatics;
        public Day(DateTime date,int totalroom,int oroom) {
            Date = date;
            TotalRoom = totalroom;
            ORoom = oroom;
            OStatics = (Decimal)(oroom/totalroom) * 100;
        }
        public Decimal getOStatic() {
            return OStatics;
        }
        public DateTime getDate() { 
        return Date;
        }
        //no need set
        public int getTotalRoom() {
            return TotalRoom;
        }
        public int getORoom()
        {
            return ORoom;
        }
        public Decimal GetStatics()
        {
            //logic of anything divide from zero is zero like wise to time
            Decimal Total = 0;
            try {
                Total = (Decimal)((Decimal)ORoom / TotalRoom) * 100;
            }
            catch (Exception ex) {
                Total =0;
            }
            
            return Total;
        }
    }
}